110 COMMON SP,FIN,D!,RK,RC,RB,RR!,RT!,KST,KB,KK,KC,G(),CX(),CY(),BX(),BY()
120 COMMON NS(),P(),UX,UY,RS,KR,RR,KS,CR,KP,Q(),KX(),KY(),KP!(),KA!(),KD!()
130 COMMON NK,NB,NR!,NC,NT!,NST,NE!,NSH!,NT,NL!,ND!,E!,S!,SU,C,T,S$
140 COMMON QX,QY,SX,SY,W!,WS!,L!,D!(),LN,S,P$,DS!,DR!,H!,T!,BX,BY,DF!
150 COMMON HK,KC,CS,NH,NKN,S(),F!(),GO,G1,A,JI,R,AD,DF!,SC,TX,TY,ND,PX,PY,O
160 COMMON LD,P,MN,NP,HE,HS,NZ,HR,CF,SN,CG,SB,SE,CP!,CT,DB,BAX,BAY,CR!(),DO,IN$
165 KEY OFF
170 OPEN "R",#1,"TREKMSGS.DAT",73:' TESTING ONLY
180 FIELD #1,73 AS TMSG$
190 GOSUB 45000:' initial instructions
195 GOTO 225
200 CLS:MSG$="'Star Trek' The Game":R=1:GOSUB 40000
210 MSG$="Instructions":R=2:GOSUB 40000
220 PRINT:PRINT:PRINT:PRINT
225 PRINT "Enter the command you wish additional information on:"
230 PRINT:FOR I=8 TO 13:GET #1,I:PRINT TMSG$:NEXT I
250 PRINT:PRINT "Command: ";:CR=CSRLIN:CC=POS(0)
255 LOCATE ,,1:GOSUB 50100:LOCATE ,,0:GOSUB 50000:IF BDKEY$="A" THEN 260
257 LOCATE 25,2:COLOR 26:PRINT "Invalid command. To play game type 'PLAY' and press ENTER.";:COLOR 7:BEEP:LOCATE CR,CC:GOTO 255
260 GOSUB 50140:IF I=0 THEN IF BDS$="PLAY" AND S$<>"" THEN CHAIN "trekmain" ELSE 257
263 GOSUB 30000
264 PRINT I;
265 ON I GOSUB 1000,2000,3000,4000,5000,6000,7000,8000,9000,10000,11000,12000,13000,14000,15000,16000,17000,18000,19000,20000,21000,22000,23000,24000,25000,26000,27000,28000,29000
270 R=25:MSG$="Press any key to return to Command Menu":COLOR 26:GOSUB 40000:COLOR 7
280 I$=INKEY$:IF I$="" THEN 280 ELSE 200
999 CLOSE #1:STOP:' TESTING ONLY
1000 'chart
1010 LOCATE 1,25:PRINT "CHART";:LOCATE 2,25:PRINT "C";:LOCATE 3,25:PRINT "None";:LOCATE 4,25:PRINT "Map of the galaxy from information obtained from":LOCATE 5,27:PRINT "long-range sensors.";
1020 LOCATE 6,1
1025 PRINT " ";:FOR J=1 TO 8:PRINT " "J;:NEXT J:PRINT
1230 LOCATE 15,50:PRINT "X - number of Klingons in":LOCATE 16,56:PRINT "quadrant";
1240 LOCATE 17,50:PRINT "Y - base in quadrant (1)"
1250 LOCATE 18,50:PRINT "Z - number of stars in quadrant";
1999 RETURN
2000 'crystals
2010 LOCATE 1,25:PRINT "CRYSTALS";:LOCATE 2,25:PRINT "CR";:LOCATE 3,25:PRINT "Dilithium Crystals, Condition Yellow";:LOCATE 4,25:PRINT "Attempt to load raw dilithium crystals into the ship's":LOCATE 5,27:PRINT "power system.";
2020 LOCATE 7,5
2030 PRINT "Dilithium crystals are obtained from mining a planet's surface. To mine":PRINT "dilithium crystals, you must:"
2040 LOCATE 10,20:PRINT "1) achieve standard orbit (ORBIT)."
2050 LOCATE ,20:PRINT "2) get down to planet surface (TRANSPORT or SHUTTLE)."
2060 LOCATE ,20:PRINT "3) mine for dilithium crystals (MINE)."
2070 LOCATE ,20:PRINT "4) get back to ship (TRANSPORT OR SHUTTLE)."
2999 RETURN
3000 'dock
3010 LOCATE 1,25:PRINT "DOCK";:LOCATE 2,25:PRINT "D";:LOCATE 3,25:PRINT "adjacent to a Starbase";:LOCATE 4,25:PRINT "Dock to a Starbase to replenish supplies and make":LOCATE 5,27:PRINT "repairs to the ship.";
3020 LOCATE 7,5
3030 PRINT "Docking will replenish your energy, shield energy, photon torpedoes and":PRINT "life support reserves. When docked repairs can be made at a much excelerated":PRINT "rate. Starbase shields provide additional protection when docked."
4070 LOCATE 18,20:PRINT "Shield Control 0.43 0.11"
4999 RETURN
5000 'impulse
5010 LOCATE 1,25:PRINT "IMPULSE [MANUAL/AUTOMATIC] [a b [c d]]";:LOCATE 2,25:PRINT "I [M/A] [a b [c d]]";:LOCATE 3,25:PRINT "Impulse engines, Computer for automatic movement";:LOCATE 4,25:PRINT "Move using impulse power.
5020 LOCATE 7,5
5030 PRINT "Impulse is one of two movement commands. Movement under impulse power is";:PRINT "extremely slow, but uses little energy. They require 20.0 units of energy to"
5040 PRINT "engage and 100.0 units per quadrant. The speed under Impulse power is only":PRINT "0.95 stardates per sector. They are very useful when the Warp engines are"
5050 PRINT "damaged.
5060 PRINT:PRINT "See MOVE for additional information.
5999 RETURN
6000 'lrscan
6010 LOCATE 1,25:PRINT "LRSCAN";:LOCATE 2,25:PRINT "L";:LOCATE 3,25:PRINT "Long-range sensors";:LOCATE 4,25:PRINT "To obtain information on adjacent quadrants.
6025 PRINT "Long range scan for quadrant 1 - 1 .":PRINT
6030 PRINT "-1 -1 -1"
6040 PRINT "-1 414 9"
6050 PRINT "-1 204 1000"
6060 LOCATE 9,54:PRINT "Legend";
6065 LOCATE 11,40:PRINT " -1 - edge of galaxy";
6070 LOCATE 13,40:PRINT "1000 - quadrant containing a Supernova";
6075 LOCATE 15,40:PRINT " XYZ = X - number of Klingons in quadrant
6090 LOCATE 16,40:PRINT " Y - base in quadrant (1 or 0)"
6095 LOCATE 17,40:PRINT " Z - number of stars in quadrant"
6999 RETURN
7000 'move
7010 LOCATE 1,25:PRINT "MOVE [MANUAL/AUTOMATIC] [a b [c d]]";:LOCATE 2,25:PRINT "M [M/A] [a b [c d]]";:LOCATE 3,25:PRINT "Warp engines, Computer for automatic movement";
7015 LOCATE 4,25:PRINT "To move from one location to another.";
7020 LOCATE 7,5
7030 PRINT "Move is one of the two movement commands. Time used and fuel consumtion":PRINT "depends on the Warp factor. Warp factor ranges from 1 to 10. At Warp factor":PRINT "ten little time is used, but a large amount of energy is consumed."
7040 PRINT:PRINT " Manual format: M M delta-X delta-Y"
7060 PRINT
7070 PRINT " Examples: M M 1.1 0 = moves "CHR$(26)" one quadrant plus one sector.
7080 PRINT " M M -.3 0 = moves "CHR$(27)" three sectors.
7120 PRINT " 0 -5.3 = moves "CHR$(24)" five quadrants plus three sectors.
7200 PRINT:PRINT "Automatic formats: M A dest-sect-Y dest-sect-X":PRINT " M A dest-quad-Y dest-quad-X dest-sect-Y dest-sect-X"
7210 PRINT
7220 PRINT " Examples: M A 4 5 = moves to sector 4 - 5.
7230 PRINT " M A 6 7 3 2 = moves to quadrant 6 - 7 sector 3 - 2.
7999 RETURN
8000 'mine
8010 LOCATE 1,25:PRINT "MINE";:LOCATE 2,25:PRINT "MI";:LOCATE 3,25:PRINT "Must be on planet surface";
8015 LOCATE 4,25:PRINT "To obtain crystals for emergency situations.";
8020 LOCATE 7,5
8030 PRINT "In order to mine for dilithium crystals, you must be on the planet surface.":PRINT "There are two ways to get to the planet surface. First, you could use the":PRINT "transporter. Secondly, the shuttle craft can be used for transportation.";
8040 PRINT:PRINT "For more information see TRANSPORT, SHUTTLE and CRYSTALS."
9015 LOCATE 4,25:PRINT "To prepare to mine for dilithium crystals.";
9020 LOCATE 7,5
9030 PRINT "Entering standard orbit is the first step in mining dilithium crystals.":PRINT "Next, you must get down to the planet surface. Two meathods are available":PRINT "transporter and shuttle craft.";
9040 PRINT:PRINT "For more information see TRANSPORT, SHUTTLE and CRYSTALS."
9999 RETURN
10000 'phasers
10010 LOCATE 1,25:PRINT "PHASERS [MANUAL/AUTOMATIC] energy {NO}";:LOCATE 2,25:PRINT "P [M/A] energy {N}";:LOCATE 3,25:PRINT "Ship energy, Phasers, Shield control if shields up.";
10015 LOCATE 4,25:PRINT "Attack enemy in battle.";
10020 LOCATE 7,5
10030 PRINT "Phasers utilize the ships energy to attack the enemy. Automatic, spreads";:PRINT "phasers to all (or as many as possible) enemies in your quadrant. You will";
10035 PRINT "be prompted in manual phasers for energy to be spent on each enemy.
10040 PRINT:PRINT TAB(5);"Energy is only allowed on the command line for automatic phasers."
10050 PRINT TAB(5);"The optional operand (NO) will not raise your shields after phasers have been":PRINT "fired using high-speed shield control."
10999 RETURN
11000 'photons
11010 LOCATE 1,25:PRINT "PHOTONS [number] [a b c d e f]";:LOCATE 2,25:PRINT "PHO [number] [a b c d e f]";:LOCATE 3,25:PRINT "Photon tubes, cannot be fired through starbase shields.";
11015 LOCATE 4,25:PRINT "Attack enemy in battle.";
11020 LOCATE 7,5
11030 PRINT "Photon torpedoes are fired at a specific enemy. They are less accurate":PRINT "through either the ship or starbase shields. You start with 10 torpedoes.":PRINT "After docking you receive a fresh supply of 10 torpedoes.":
11040 PRINT TAB(5);"Rarely but sometimes, a photon may misfire. That torpedoe and the":PRINT "remainder of the burst will be aborted. Damage may also result from a":PRINT " misfire."
12020 LOCATE 4,25:PRINT "Summary of information obtained from sensors.
12030 LOCATE 7,5
12040 PRINT TAB(5);"Information obtained through sensors is retained during your battle. The":PRINT "PLANET command displays this information in summary form. Below is a sample":PRINT "readout:"
45010 CLS:MSG$="'Star Trek' The Game":R=1:GOSUB 40000
45020 MSG$="Instructions":R=2:GOSUB 40000
45030 LOCATE 4,1,0
45040 PRINT TAB(5);"Commands may be entered any time you see the 'Command:' prompt. Most";:PRINT "commands and operands can be abbreviated with a single letter. A comma or space";
45050 PRINT "must separate commands and operands. Numeric operands are accepted with a";:PRINT "decimal point and/or a leading sign."
45055 PRINT:PRINT TAB(5);"The detailed instructions of a command contains an item called 'Command";:PRINT "format'. An item on this line containing a set of [ ] are optional on the";
45057 PRINT "command. There will be a prompt for any required item if it was not supplied";:PRINT "on the command line. A set of { } brackets signify an optional item. If it is";
45058 PRINT "is omitted, there will ";:COLOR 1:PRINT "not";:COLOR 7:PRINT " be a prompt for that item."
45098 PRINT
45099 RETURN
50000 ' break down IN$
50005 IF LEN(IN$)=0 THEN BDKEY$="*":RETURN
50010 BDB$=LEFT$(IN$,1):IF BDB$<>" " THEN 50015 ELSE IN$=RIGHT$(IN$,LEN(IN$)-1):GOTO 50005
50015 BDS$=""
50020 IF BDB$>="A" AND BDB$<="Z" THEN 50070
50025 ' numeric
50030 IF BDB$="-" OR BDB$="+" THEN IN$=RIGHT$(IN$,LEN(IN$)-1):BDF=VAL(BDB$+"1") ELSE BDF=1
50035 BDKEY$="I"
50040 IF LEN(IN$)=0 THEN 50055
50045 BDB$=LEFT$(IN$,1):IF (BDB$<"0" AND BDB$<>".") OR BDB$>"9" THEN 50055 ELSE BDS$=BDS$+BDB$:IN$=RIGHT$(IN$,LEN(IN$)-1):IF BDB$="." THEN BDKEY$="F"
50050 GOTO 50040
50055 IF LEN(BDS$)=0 THEN BDKEY$="*":RETURN
50060 IF BDKEY$="I" THEN BDI=VAL(BDS$)*BDF ELSE BDF!=VAL(BDS$)*BDF
50065 RETURN
50070 ' alpha
50075 IF LEN(IN$)=0 THEN 50085
50080 BDB$=LEFT$(IN$,1):IF BDB$=" " THEN 50085 ELSE BDS$=BDS$+BDB$:IN$=RIGHT$(IN$,LEN(IN$)-1):GOTO 50075
50085 IF LEN(BDS$)=0 THEN BDKEY$="*":RETURN
50090 BDKEY$="A"
50095 RETURN
50100 ' input IN$
50105 IN$=""
50110 I$=INKEY$:IF I$="" THEN 50110 ELSE IF LEN(I$)=2 THEN BEEP:GOTO 50110
50115 IF I$=CHR$(13) THEN RETURN:' PRINT:RETURN
50120 IF I$=CHR$(8) THEN IF LEN(IN$)<>0 THEN IN$=LEFT$(IN$,LEN(IN$)-1):PRINT CHR$(29);" ";CHR$(29);:GOTO 50110 ELSE BEEP:GOTO 50110
50125 IF I$<" " THEN BEEP:GOTO 50010
50130 IF I$>="a" AND I$<="z" THEN I$=CHR$(ASC(I$)-32)
50135 IN$=IN$+I$:PRINT I$;:GOTO 50110
50140 ' GET COMMAND
50145 ' try match on long commands
50150 RESTORE 50185:FOR I=22 TO 29:READ COMMAND$:IF COMMAND$=BDS$ THEN 50160 ELSE NEXT I
50155 RESTORE 50165:FOR I=1 TO 21:READ COMMAND$:IF LEFT$(COMMAND$,LEN(BDS$))=BDS$ THEN 50160 ELSE NEXT I:I=0
50160 COMM=I:RETURN
50165 DATA "CHART","CRYSTALS","DOCK","DAMAGES","IMPULSE","LRSCAN","MOVE","MINE"
50170 DATA "ORBIT","PHASERS","PHOTONS","PLANETS"
50175 DATA "SRSCAN","SENSORS","SHIELDS","SHUTTLE","STATUS","TRANSPORT"
50180 DATA "REQUEST","REST","WARP"
50185 DATA "ABANDON","DEATHRAY","DESTRUCT","HELP","TERMINATE","COMMAND","FREEZE","THAW"